<?php

/**
 * Level form base class.
 *
 * @package    elearning
 * @subpackage form
 * @author     Your name here
 */
class BaseLevelForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                      => new sfWidgetFormInputHidden(),
      'course_id'               => new sfWidgetFormPropelChoice(array('model' => 'Course', 'add_empty' => false)),
      'level_price'             => new sfWidgetFormInput(),
      'level_status'            => new sfWidgetFormInput(),
      'teach_sessions_per_week' => new sfWidgetFormInput(),
      'prac_sessions_per_week'  => new sfWidgetFormInput(),
      'total_sessions'          => new sfWidgetFormInput(),
      'duration_in_week'        => new sfWidgetFormInput(),
      'create_at'               => new sfWidgetFormDateTime(),
      'update_at'               => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                      => new sfValidatorPropelChoice(array('model' => 'Level', 'column' => 'id', 'required' => false)),
      'course_id'               => new sfValidatorPropelChoice(array('model' => 'Course', 'column' => 'id')),
      'level_price'             => new sfValidatorNumber(),
      'level_status'            => new sfValidatorInteger(),
      'teach_sessions_per_week' => new sfValidatorInteger(),
      'prac_sessions_per_week'  => new sfValidatorInteger(),
      'total_sessions'          => new sfValidatorInteger(),
      'duration_in_week'        => new sfValidatorInteger(),
      'create_at'               => new sfValidatorDateTime(),
      'update_at'               => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('level[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Level';
  }

  public function getI18nModelName()
  {
    return 'LevelI18n';
  }

  public function getI18nFormClass()
  {
    return 'LevelI18nForm';
  }

}
